<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InfdTcpServer</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
<link rel="home" href="index.html" title="libinfinity-0.4 Reference Manual">
<link rel="up" href="ch05.html" title="Libinfinity server side API">
<link rel="prev" href="InfdSessionProxy.html" title="InfdSessionProxy">
<link rel="next" href="InfdXmlServer.html" title="InfdXmlServer">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="InfdSessionProxy.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch05.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libinfinity-0.4 Reference Manual</th>
<td><a accesskey="n" href="InfdXmlServer.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#InfdTcpServer.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#InfdTcpServer.description" class="shortcut">Description</a>
                   | 
                  <a href="#InfdTcpServer.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#InfdTcpServer.properties" class="shortcut">Properties</a>
                   | 
                  <a href="#InfdTcpServer.signals" class="shortcut">Signals</a>
</td></tr>
</table>
<div class="refentry" title="InfdTcpServer">
<a name="InfdTcpServer"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="InfdTcpServer.top_of_page"></a>InfdTcpServer</span></h2>
<p>InfdTcpServer</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="InfdTcpServer.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">enum                <a class="link" href="InfdTcpServer.html#InfdTcpServerStatus" title="enum InfdTcpServerStatus">InfdTcpServerStatus</a>;
                    <a class="link" href="InfdTcpServer.html#InfdTcpServer-struct" title="InfdTcpServer">InfdTcpServer</a>;
                    <a class="link" href="InfdTcpServer.html#InfdTcpServerClass" title="InfdTcpServerClass">InfdTcpServerClass</a>;
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="InfdTcpServer.html#infd-tcp-server-bind" title="infd_tcp_server_bind ()">infd_tcp_server_bind</a>                (<em class="parameter"><code><a class="link" href="InfdTcpServer.html" title="InfdTcpServer"><span class="type">InfdTcpServer</span></a> *server</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="InfdTcpServer.html#infd-tcp-server-open" title="infd_tcp_server_open ()">infd_tcp_server_open</a>                (<em class="parameter"><code><a class="link" href="InfdTcpServer.html" title="InfdTcpServer"><span class="type">InfdTcpServer</span></a> *server</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfdTcpServer.html#infd-tcp-server-close" title="infd_tcp_server_close ()">infd_tcp_server_close</a>               (<em class="parameter"><code><a class="link" href="InfdTcpServer.html" title="InfdTcpServer"><span class="type">InfdTcpServer</span></a> *server</code></em>);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="InfdTcpServer.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----InfdTcpServer
</pre>
</div>
<div class="refsect1" title="Properties">
<a name="InfdTcpServer.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="InfdTcpServer.html#InfdTcpServer--io" title='The "io" property'>io</a>"                       <a class="link" href="InfIo.html" title="InfIo"><span class="type">InfIo</span></a>*                : Read / Write / Construct Only
  "<a class="link" href="InfdTcpServer.html#InfdTcpServer--local-address" title='The "local-address" property'>local-address</a>"            <a class="link" href="libinfinity-0.4-InfIpAddress.html#InfIpAddress" title="InfIpAddress"><span class="type">InfIpAddress</span></a>*         : Read / Write
  "<a class="link" href="InfdTcpServer.html#InfdTcpServer--local-port" title='The "local-port" property'>local-port</a>"               <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a>                 : Read / Write
  "<a class="link" href="InfdTcpServer.html#InfdTcpServer--status" title='The "status" property'>status</a>"                   <a class="link" href="InfdTcpServer.html#InfdTcpServerStatus" title="enum InfdTcpServerStatus"><span class="type">InfdTcpServerStatus</span></a>   : Read
</pre>
</div>
<div class="refsect1" title="Signals">
<a name="InfdTcpServer.signals"></a><h2>Signals</h2>
<pre class="synopsis">
  "<a class="link" href="InfdTcpServer.html#InfdTcpServer-error" title='The "error" signal'>error</a>"                                          : Run Last
  "<a class="link" href="InfdTcpServer.html#InfdTcpServer-new-connection" title='The "new-connection" signal'>new-connection</a>"                                 : Run Last
</pre>
</div>
<div class="refsect1" title="Description">
<a name="InfdTcpServer.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1" title="Details">
<a name="InfdTcpServer.details"></a><h2>Details</h2>
<div class="refsect2" title="enum InfdTcpServerStatus">
<a name="InfdTcpServerStatus"></a><h3>enum InfdTcpServerStatus</h3>
<pre class="programlisting">typedef enum _InfdTcpServerStatus {
  INFD_TCP_SERVER_CLOSED,
  INFD_TCP_SERVER_BOUND,
  INFD_TCP_SERVER_OPEN
} InfdTcpServerStatus;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="InfdTcpServer">
<a name="InfdTcpServer-struct"></a><h3>InfdTcpServer</h3>
<pre class="programlisting">typedef struct _InfdTcpServer InfdTcpServer;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="InfdTcpServerClass">
<a name="InfdTcpServerClass"></a><h3>InfdTcpServerClass</h3>
<pre class="programlisting">typedef struct {
  GObjectClass parent_class;

  /* Signals */
  void (*new_connection)(InfdTcpServer* server,
                         InfTcpConnection* connection);

  void (*error)(InfdTcpServer* server,
                GError* error);
} InfdTcpServerClass;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="infd_tcp_server_bind ()">
<a name="infd-tcp-server-bind"></a><h3>infd_tcp_server_bind ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            infd_tcp_server_bind                (<em class="parameter"><code><a class="link" href="InfdTcpServer.html" title="InfdTcpServer"><span class="type">InfdTcpServer</span></a> *server</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Binds the server to the address and port given by the
<a class="link" href="InfdTcpServer.html#InfdTcpServer--local-address" title='The "local-address" property'><span class="type">"local-address"</span></a> and <a class="link" href="InfdTcpServer.html#InfdTcpServer--local-port" title='The "local-port" property'><span class="type">"local-port"</span></a> properties. If
the former is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, it will bind on all interfaces on IPv4. If the latter
is 0, a random available port will be assigned. If the function fails,
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned and an error is set.
</p>
<p>
<em class="parameter"><code>server</code></em> must be in <code class="literal">INFD_TCP_SERVER_CLOSED</code> state for this function to be
called.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>server</code></em> :</span></p></td>
<td>A <a class="link" href="InfdTcpServer.html" title="InfdTcpServer"><span class="type">InfdTcpServer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Location to store error information, if any.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if an error occured.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="infd_tcp_server_open ()">
<a name="infd-tcp-server-open"></a><h3>infd_tcp_server_open ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            infd_tcp_server_open                (<em class="parameter"><code><a class="link" href="InfdTcpServer.html" title="InfdTcpServer"><span class="type">InfdTcpServer</span></a> *server</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Attempts to open <em class="parameter"><code>server</code></em>. This means binding its local address and port
if not already (see <a class="link" href="InfdTcpServer.html#infd-tcp-server-bind" title="infd_tcp_server_bind ()"><code class="function">infd_tcp_server_bind()</code></a>) and accepting incoming
connections.
</p>
<p>
<em class="parameter"><code>server</code></em> needs to be in <code class="literal">INFD_TCP_SERVER_CLOSED</code> or <code class="literal">INFD_TCP_SERVER_BOUND</code>
status for this function to be called. If <em class="parameter"><code>server</code></em>'s status is
<code class="literal">INFD_TCP_SERVER_CLOSED</code>, then <a class="link" href="InfdTcpServer.html#infd-tcp-server-bind" title="infd_tcp_server_bind ()"><code class="function">infd_tcp_server_bind()</code></a> is called before
actually opening the server.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>server</code></em> :</span></p></td>
<td>A <a class="link" href="InfdTcpServer.html" title="InfdTcpServer"><span class="type">InfdTcpServer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Location to store error information.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if an error occured.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="infd_tcp_server_close ()">
<a name="infd-tcp-server-close"></a><h3>infd_tcp_server_close ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                infd_tcp_server_close               (<em class="parameter"><code><a class="link" href="InfdTcpServer.html" title="InfdTcpServer"><span class="type">InfdTcpServer</span></a> *server</code></em>);</pre>
<p>
Closes a TCP server that is open or bound.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>server</code></em> :</span></p></td>
<td>A <a class="link" href="InfdTcpServer.html" title="InfdTcpServer"><span class="type">InfdTcpServer</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="InfdTcpServer.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "io" property'>
<a name="InfdTcpServer--io"></a><h3>The <code class="literal">"io"</code> property</h3>
<pre class="programlisting">  "io"                       <a class="link" href="InfIo.html" title="InfIo"><span class="type">InfIo</span></a>*                : Read / Write / Construct Only</pre>
<p>I/O handler.</p>
</div>
<hr>
<div class="refsect2" title='The "local-address" property'>
<a name="InfdTcpServer--local-address"></a><h3>The <code class="literal">"local-address"</code> property</h3>
<pre class="programlisting">  "local-address"            <a class="link" href="libinfinity-0.4-InfIpAddress.html#InfIpAddress" title="InfIpAddress"><span class="type">InfIpAddress</span></a>*         : Read / Write</pre>
<p>Address to bind to.</p>
</div>
<hr>
<div class="refsect2" title='The "local-port" property'>
<a name="InfdTcpServer--local-port"></a><h3>The <code class="literal">"local-port"</code> property</h3>
<pre class="programlisting">  "local-port"               <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a>                 : Read / Write</pre>
<p>Port to bind to.</p>
<p>Allowed values: &lt;= 65535</p>
<p>Default value: 0</p>
</div>
<hr>
<div class="refsect2" title='The "status" property'>
<a name="InfdTcpServer--status"></a><h3>The <code class="literal">"status"</code> property</h3>
<pre class="programlisting">  "status"                   <a class="link" href="InfdTcpServer.html#InfdTcpServerStatus" title="enum InfdTcpServerStatus"><span class="type">InfdTcpServerStatus</span></a>   : Read</pre>
<p>Status of the TCP server.</p>
<p>Default value: INFD_TCP_SERVER_CLOSED</p>
</div>
</div>
<div class="refsect1" title="Signal Details">
<a name="InfdTcpServer.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2" title='The "error" signal'>
<a name="InfdTcpServer-error"></a><h3>The <code class="literal">"error"</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                user_function                      (<a class="link" href="InfdTcpServer.html" title="InfdTcpServer"><span class="type">InfdTcpServer</span></a> *infdtcpserver,
                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>       arg1,
                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>       user_data)          : Run Last</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>infdtcpserver</code></em> :</span></p></td>
<td>the object which received the signal.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>arg1</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title='The "new-connection" signal'>
<a name="InfdTcpServer-new-connection"></a><h3>The <code class="literal">"new-connection"</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                user_function                      (<a class="link" href="InfdTcpServer.html" title="InfdTcpServer"><span class="type">InfdTcpServer</span></a>    *infdtcpserver,
                                                        <a class="link" href="InfTcpConnection.html" title="InfTcpConnection"><span class="type">InfTcpConnection</span></a> *arg1,
                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>          user_data)          : Run Last</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>infdtcpserver</code></em> :</span></p></td>
<td>the object which received the signal.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>arg1</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>